using System;
using System.Collections;
using System.Collections.Generic;

namespace Dida
{
	public class ComparerGenericWrapper<T> : IComparer
	{
		IComparer<T> comparer;

		public ComparerGenericWrapper(IComparer<T> comparer)
		{
			this.comparer = comparer;
		}

		#region IComparer Members

		public int Compare(object x, object y)
		{
			return comparer.Compare((T)x, (T)y);
		}

		#endregion
	}

	public static class ArrayTools
	{
		public static T[] GetSubArray<T>(T[] src,int startIndex, int size)
		{
			T[] ret = new T[size];
			for (int i = 0; i < size; i++)
				ret[i] = src[i + startIndex];
			return ret;
		}
	}
}